/*
 * DoubleLeakyBucket.h
 *
 *  Created on: 12-12-2013
 *      Author: Tomasz Lis
 */

#ifndef DOUBLELEAKYBUCKET_H_
#define DOUBLELEAKYBUCKET_H_

#include <omnetpp.h>
#include <csimplemodule.h>
#include <vector>
#include <packet_m.h>
#include <fstream>

using namespace std;

class DoubleLeakyBucketProfiler: public cSimpleModule {
public:
    simtime_t lastPacketTime;
    cLongHistogram histogram;
    cOutVector vectorA;


    int numberOfDeletedMinPrior;
    int numberOfDeletedMaxPrior;
    int numberOfDeleted;
    int numberOfForward;

    int currentBytes;
    int currentBytes2;
    int bytePerTime;
  //  int bytePerTime2;
    double timePeriod;
    //unsigned int maxSize1;
    //unsigned int maxSize2;
    simtime_t lastForward;
    vector<Packet*> bucket1;
    vector<Packet*> bucket2;
    cMessage* event;
    cMessage* event2;
    DoubleLeakyBucketProfiler();
    virtual ~DoubleLeakyBucketProfiler();
    void sendPacket();
    void bucket1ToBucket2();
    virtual void handleMessage(cMessage* msg);
    virtual void initialize();
    virtual void finish();
};

Define_Module(DoubleLeakyBucketProfiler);
#endif /* DOUBLELEAKYBUCKET_H_ */
